package com.ruoyi.depot.mapper;

import com.ruoyi.depot.domain.DTOReceiptProducts;
import com.ruoyi.depot.domain.ReceiptProducts;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
* @author Admin
* @description 针对表【tb_receipt_products】的数据库操作Mapper
* @createDate 2024-11-01 18:31:44
* @Entity com.ruoyi.depot.domain.ReceiptProducts
*/
@Mapper
public interface ReceiptProductsMapper extends BaseMapper<ReceiptProducts> {

	/**
	 * 批量更新收货商品详细数据
	 * @param updatedProducts
	 * @return
	 */
	int updateBatchByCompositeKey(@Param("updatedProducts") List<ReceiptProducts> updatedProducts);

	/**
	 * 根据收货单id、产品id、gtin查询对应的收货单明细
	 * @param receiptId
	 * @param productId
	 * @param candidateGtin
	 * @return
	 */
	DTOReceiptProducts selectByReceiptIdAndProductIdAndGTIN(@Param("receiptId") String receiptId,
															@Param("productId") Long productId,
															@Param("gtin") String candidateGtin);

	/**
	 * 根据收货单id和产品id查询所有的收获单详细
	 * @param receiptIds
	 * @param productIds
	 * @return
	 */
	List<ReceiptProducts> selectByReceiptIdAndProductIdList(@Param("receiptIds") Set<String> receiptIds,
															@Param("productIds") Set<Long> productIds);
}




